project(zkbfcp)

set(bfcp_HEADERS bfcp_message_processing/bfcp_messages.h
                 bfcp_message_processing/bfcp_strings.h
)

set(bfcp_SOURCES bfcp_message_processing/bfcp_messages.c
                 bfcp_message_processing/bfcp_messages_build.c
                 bfcp_message_processing/bfcp_messages_parse.c
)

set(HEADERS BfcpMessageIf.hxx
            BfcpNetTuple.hxx
            BfcpParticipantKey.hxx
            BfcpSendData.hxx
            BfcpStack.hxx
            BfcpTransactionMessage.hxx
            BfcpTransportEventThread.hxx
            BfcpTransportIf.hxx
            BfcpUdpTransport.hxx
            ${bfcp_HEADERS}
)

set(SOURCES BfcpMessage.cxx
            BfcpMessageIf.cxx
            BfcpNetTuple.cxx
            BfcpParticipantKey.cxx
            BfcpStack.cxx
            BfcpTransportEventThread.cxx
            BfcpTransportIf.cxx
            BfcpUdpTransport.cxx
            BfcpMessage.hxx
            ${bfcp_SOURCES}
)

source_group("bfcp_message_processing" FILES ${bfcp_HEADERS} ${bfcp_SOURCES})
source_group("" FILES ${HEADERS} ${SOURCES})
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../rutil )
target_link_libraries(${PROJECT_NAME} PRIVATE rutil zklog)
if(MSVC)
  target_link_libraries(${PROJECT_NAME} PUBLIC Ws2_32.lib Iphlpapi.lib winmm.lib Dnsapi.lib)
else()
  target_link_libraries(${PROJECT_NAME} PUBLIC pthread)
endif()